home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection 1998 Fall: Game Toolkit / Disc.iso / SDKs / PCI Driver Development Kit / • Tools / Utility / LogLibrary 950622 / MakeFile < prev   
Encoding:
Makefile  |  1996-08-20  |  6.0 KB  |  243 lines  |  [TEXT/MPS ]

  1. #
  2. # This MPW script builds the MacsBug Log dcmd and the display
  3. # application.
  4. # Copyright © 1992-94, Apple Computer Inc. All Rights Reserved.
  5. # 93.12.06 MM Revised for "AuditLib" reorganization.
  6. # 94.07.08 MM Revised for Universal Headers and Power PC native code.
  7. # 94.12.17 MM Revised for DriverLog (no 68000 application yet)
  8. # 94.01.21 MM Revised for DisplayLog, got dcmd working.
  9. # 95.03.31 MM Removed DisplayLog, using DumpLog only.
  10. # 95.05.26 MM Requires MPW 3.3 (PPCLink supports "-share globals", uses SC)
  11. #
  12. # Note that "DisplayLog" (no space) is the DCMD resource, while
  13. # "DumpLog" is the display application.
  14. #
  15. # (<CMD>/B: DisplayLog or DumpLog)
  16. #
  17. # Definitions
  18. #    DCMD                DCMD directory tree
  19. #    DCMDIncludes        Header files in DCMD tree
  20. #    DCMDLibraries        Object files in DCMD tree
  21. #    PCICIncludes        -> PCI header files (in Userstartup•PCI)
  22. #    PCILibraries        -> PCI system libraries (in Userstartup•PCI)
  23. #
  24. Creator            =    MAM1
  25. FileType        =    shlb
  26. CCompiler        =    C        ## SC for MPW 3.3
  27.  
  28. Src                =    ":Src:"
  29. DCMD            =    ":LogDCMDSrc:"
  30. Obj                =    ":Obj:"
  31. {Obj}            ƒ    {Src}
  32. #
  33. # PCICIncludes    Defined by UserStartup•PCI in System Preferences
  34. # PCILibraries    Defined by UserStartup•PCI in System Preferences
  35. #
  36. SymOpt          = on
  37. PPCCOpt         = off
  38. DCMDIncludes    =    "{DCMD}dcmd_Includes:"
  39. DCMDLibraries    =    "{DCMD}dcmd_Libraries:"
  40.  
  41. #
  42. # Headers is slightly overkill, as it will rebuild the library even
  43. # if only the display routine changes.
  44. #
  45. Headers    =                                        ∂
  46.         {Src}DumpLog.h                            ∂
  47.         {Src}LogLibrary.h
  48.  
  49. #
  50. # These files are compiled into a shared library.
  51. #
  52. LibraryObjPPC    =                                ∂
  53.         {Obj}LogLibrary.c.lib.po
  54.  
  55. LibraryExports    =                                ∂
  56.         {Obj}LogLibrary.c.lib.x
  57.  
  58. Objects    =                                        ∂
  59.         {Obj}DumpLog.c.po                        ∂
  60.         {Obj}DumpLogMain.c.po                    ∂
  61.         {Obj}LogConvertTimestamp.c.po            ∂
  62.         {Obj}LogFormat.c.po                        ∂
  63.         {Obj}LogFormatTimestamp.c.po            ∂
  64.         {Obj}MathLib64.c.po                        ∂
  65.         {Obj}StatusWindow.c.po
  66.  
  67. #
  68. # This does not include the dcmd itself.
  69. #
  70. DCMDObjects =                                    ∂
  71.         {Obj}LogConvertTimestamp.c.mo            ∂
  72.         {Obj}LogFormat.c.mo                        ∂
  73.         {Obj}LogLibrary.c.mo                    ∂
  74.         {Obj}MathLib64.c.mo
  75.  
  76. #
  77. # Compiler dependencies -- common to all compilations The idea here
  78. # is that all sources are stored in a {...Src} subdirectory, and all
  79. # objects and code resources output by the linker are stored in the
  80. # {Obj} subdirectory.
  81. #
  82. .c.mo ƒ .c                                        ∂
  83.         {Headers}
  84.     {CCompiler} {COptions} -mbg full -trace never -r    ∂
  85.         -d MPW                                    ∂
  86.         -d ISPPC=0                                ∂
  87.         -i "{PCICIncludes}"                        ∂
  88.         -o {TargDir}{Default}.c.mo                ∂
  89.         {DepDir}{Default}.c
  90.  
  91. .c.po ƒ .c                                        ∂
  92.         {Headers}
  93.     PPCC -sym on -appleext on -w                ∂
  94.         -d MPW                                    ∂
  95.         -d ISPPC=1                                ∂
  96.         -i "{PCICIncludes}"                        ∂
  97.         -o {TargDir}{Default}.c.po                ∂
  98.         {DepDir}{Default}.c
  99.  
  100. .c.lib.po ƒ .c                                    ∂
  101.         {Headers}
  102.     PPCC -sym on -appleext on -w                ∂
  103.         -d MPW                                    ∂
  104.         -d ISPPC=1                                ∂
  105.         -i "{PCICIncludes}"                        ∂
  106.         -shared_lib_export on                    ∂
  107.         -export_list {TargDir}{Default}.c.lib.x    ∂
  108.         -o {TargDir}{Default}.c.lib.po            ∂
  109.         {DepDir}{Default}.c
  110.  
  111. #* * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  112. #* Build LogLibrary shared library and copy the new
  113. #* library to the System Folder.
  114. #
  115. LogLibrary ƒ                                    ∂
  116.         MakeFile                                ∂
  117.         {Src}LogLibrary.h                        ∂
  118.         {LibraryObjPPC}
  119.     PPCLink                                        ∂
  120.         {LibraryObjPPC}                            ∂
  121.         "{PCILibraries}"DriverServicesLib        ∂
  122.         "{PCILibraries}"NameRegistryLib            ∂
  123.         -export `ConvertExportList {LibraryExports}` ∂
  124.         -share global                            ∂
  125.         -xm s                                    ∂
  126.         -t {FileType}                            ∂
  127.         -c {Creator}                            ∂
  128.         -o {targ}
  129.  
  130. InstallLibrary    ƒ                                ∂
  131.         LogLibrary
  132.     Duplicate                                    ∂
  133.         -y                                        ∂
  134.         LogLibrary                                ∂
  135.         "{SystemFolder}Extensions:LogLibrary"
  136.  
  137.  
  138. #* * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  139. #* Everything
  140. #*
  141. Everything    ƒ                                    ∂
  142.         LogLibrary                                ∂
  143.         MetroWerks                                ∂
  144.         DisplayLog                                ∂
  145.         DumpLog_MPW
  146.     echo Done
  147.  
  148. #* * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  149. #* DumpLog
  150. #*
  151. DumpLog_MPW ƒƒ                                    ∂
  152.         MakeFile                                ∂
  153.         {Headers}                                ∂
  154.         LogLibrary                                ∂
  155.         {Objects}
  156.     PPCLink                                        ∂
  157.         {Objects}                                ∂
  158.         "{PCILibraries}"DriverServicesLib        ∂
  159.         "{PPCLibraries}"InterfaceLib.xcoff        ∂
  160.         "{PPCLibraries}"PPCCRuntime.o            ∂
  161.         LogLibrary                                ∂
  162.         -main main                                ∂
  163.         -o "{Obj}"{targ}".xcoff"
  164.     MakePEF                                        ∂
  165.         -l InterfaceLib.xcoff=InterfaceLib        ∂
  166.         -l DriverServicesLib.xcoff=DriverServicesLib ∂
  167.         -l LogLibrary                            ∂
  168.         -ft APPL                                ∂
  169.         -o "{targ}"                                ∂
  170.         "{Obj}"{targ}".xcoff"
  171.  
  172. DumpLog_MPW ƒƒ                                    ∂
  173.         {Headers}                                ∂
  174.         {Src}DumpLog.r
  175.     Rez                                            ∂
  176.         -d "MPW=1"                                ∂
  177.         -d "ISPPC=1"                            ∂
  178.         -append                                    ∂
  179.         -t APPL                                    ∂
  180.         -i "{CIncludes}"                        ∂
  181.         -i "{RIncludes}"                        ∂
  182.         {Src}DumpLog.r                            ∂
  183.         -o "{targ}"
  184.  
  185.  
  186. #* * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  187. #* Build the DCMD - the name is the name that will be used
  188. #* by MacsBug. Note, for some reason, the Rez statement
  189. #* often fails, so you have to put the dcmd resource
  190. #* into the Debugger Prefs file by hand.
  191. #*
  192. DisplayLog ƒ                                    ∂
  193.         Makefile                                ∂
  194.     ##    LogLibrary                                ∂
  195.         {DCMDObjects}                            ∂
  196.         {Obj}LogDCMD.c.mo
  197.     Link                                        ∂
  198.         -o {targ}                                ∂
  199.         -c RSED                                    ∂
  200.         -t rsrc                                    ∂
  201.         "{DCMDLibraries}"dcmdGlue.a.o            ∂
  202.         {Obj}LogDCMD.c.mo                        ∂
  203.         {DCMDObjects}                            ∂
  204.         "{Libraries}"Runtime.o                    ∂
  205.         "{Libraries}"Interface.o
  206.     {DCMD}BuildDcmd {targ} 20000
  207.  
  208. Install ƒ                                        ∂
  209.         DisplayLog
  210.     Echo 'include "DisplayLog"' "'dcmd' (20000);" ∂
  211.         | Rez -a -o "{SystemFolder}Debugger Prefs"
  212.  
  213. "{Obj}"LogDCMD.c.mo ƒ                            ∂
  214.         "{DCMD}"LogDCMD.c                        ∂
  215.         {Headers}
  216.     C {COptions} -mbg full -trace never -r        ∂
  217.         -d MPW                                    ∂
  218.         -d ISPPC=0                                ∂
  219.         -i "{DCMDIncludes}"                        ∂
  220.         -i "{PCICIncludes}"                        ∂
  221.         -o "{Obj}"LogDCMD.c.mo                    ∂
  222.         "{DCMD}"LogDCMD.c
  223.  
  224. #* * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  225. #*
  226. #* Build the MetroWerks resources
  227. #*
  228. MetroWerks ƒ                                    ∂
  229.             "DumpLog.Δ.rsrc"
  230.         echo "MetroWerks resources created"
  231. "DumpLog.Δ.rsrc" ƒ                                ∂
  232.             MakeFile                            ∂
  233.             {Headers}                            ∂
  234.             {Src}DumpLog.r
  235.         Rez                                        ∂
  236.             {Src}DumpLog.r                        ∂
  237.             -d "ISPPC=1"                        ∂
  238.             -t rsrc                                ∂
  239.             -c RSED                                ∂
  240.             -i "{CIncludes}"                    ∂
  241.             -i "{RIncludes}"                    ∂
  242.             -o {targ}
  243.